package com.itheima.proxy.jdk;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @program: design
 * @description:
 * @author: zhanghz001
 * @create: 2020-11-26 17:21
 **/
public class QFang implements InvocationHandler {
    private final LandlordService landlordService;

    public QFang(LandlordService landlordService) {
        this.landlordService = landlordService;

    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        args[0] = args[0] + "房东来找你收房租了";
        return method.invoke(landlordService, args);
    }
}
